﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace USB_CANDemo
{
   public static class UtilHelper
    {
        #region 滤波设置
        public static byte[] CloseAllMask()//all
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x00;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no1Mask()//1
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x40;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no1MaskClose()//1
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x40;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no2Mask()//2
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x60;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no2MaskClose()//2
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x60;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no3Mask()//3
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x80;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no3MaskClose()//3
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x80;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no4Mask()//4
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0xa0;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no4MaskClose()//4
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0xa0;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no5Mask()//5
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0xc0;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no5MaskClose()//5
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0xc0;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no6Mask()//6
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0xe0;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no6MaskClose()//6
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x00;    //过滤的ID
            BasicFunctionSet_Array[6] = 0xe0;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no7Mask()//7
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x01;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x00;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no7MaskClose()//7
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x01;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x00;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no8Mask()//8
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x01;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x01;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x20;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        public static byte[] no8MaskClose()//8
        {
            byte[] BasicFunctionSet_Array = new byte[30];
            BasicFunctionSet_Array[0] = 0x55; //报文头
            BasicFunctionSet_Array[1] = 0xAA;
            BasicFunctionSet_Array[2] = 0x02; // 功能码
            BasicFunctionSet_Array[3] = 0X00; // 过滤编号
            BasicFunctionSet_Array[4] = 0x00;//打开或者关闭过滤器
            BasicFunctionSet_Array[5] = 0x01;    //过滤的ID
            BasicFunctionSet_Array[6] = 0x20;
            BasicFunctionSet_Array[7] = 0x00;
            BasicFunctionSet_Array[8] = 0x00;
            BasicFunctionSet_Array[9] = 0xFF;
            //BasicFunctionSet_Array[10] = 0xE0;
            //BasicFunctionSet_Array[11] = 0x00;
            //BasicFunctionSet_Array[12] = 0x06;
            BasicFunctionSet_Array[10] = 0xFF;
            BasicFunctionSet_Array[11] = 0xFF;
            BasicFunctionSet_Array[12] = 0xFF;
            BasicFunctionSet_Array[28] = GetSumForCommand(BasicFunctionSet_Array);
            BasicFunctionSet_Array[29] = 0x88;
            return BasicFunctionSet_Array;
        }
        #endregion
        public static byte GetSumForCommand(byte[] Array)  // 专用求和函数
        {
            byte Sum = 0;
            for (byte temp = 0; temp <= 27; temp++)
            {
                Sum = (byte)(Sum + Array[temp]);
            }
            return Sum;
        }
        #region 测试命令
        public static byte[] stopTest()//停止测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //秒数
            dataBuf[16] = 0x00;  //阶段
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no1Test()//板一测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x02;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no1RedTest()//板一红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x02;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no1YelTest()//板一黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x02;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no1GreTest()//板一绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x02;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }

        public static byte[] no2Test()//板二测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x03;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no2RedTest()//板2红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x03;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no2YelTest()//板2黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x03;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no2GreTest()//板2绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x03;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no3Test()//板3测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x04;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no3RedTest()//板3红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x04;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no3YelTest()//板3黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x04;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no3GreTest()//板3绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x04;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no4Test()//板4测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x05;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no4RedTest()//板4红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x05;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no4YelTest()//板4黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x05;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no4GreTest()//板4绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x05;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no5Test()//板5测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x06;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no5RedTest()//板5红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x06;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no5YelTest()//板5黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x06;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no5GreTest()//板5绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x06;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no6Test()//板6测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x07;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no6RedTest()//板6红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x07;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no6YelTest()//板6黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x07;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no6GreTest()//板6绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x07;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no7Test()//板7测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x08;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no7RedTest()//板7红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x08;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no7YelTest()//板7黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x08;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no7GreTest()//板7绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x08;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no8Test()//板8测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x00;
            dataBuf[12] = 0x00;
            dataBuf[13] = 0x00;
            dataBuf[14] = 0x00;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x05;  //
            dataBuf[16] = 0x09;  //id
            dataBuf[17] = 0x40;  //命令字
            dataBuf[18] = 0xbb;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no8RedTest()//板8红灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x01;
            dataBuf[12] = 0x01;
            dataBuf[13] = 0x01;
            dataBuf[14] = 0x01;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x09;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no8YelTest()//板8黄灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x02;
            dataBuf[12] = 0x02;
            dataBuf[13] = 0x02;
            dataBuf[14] = 0x02;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x09;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        public static byte[] no8GreTest()//板8绿灯测试
        {
            byte[] dataBuf = new byte[30];
            dataBuf[0] = 0x55; //报文头
            dataBuf[1] = 0xAA;
            dataBuf[2] = 0x03; // 功能码 发送功能码 05
            //TIR 表示标准帧，数据帧 3-6 一个8位 标识符寄存器  01 20 00 00 (21--31)标识9
            dataBuf[3] = 0x00;
            dataBuf[4] = 0x20;
            dataBuf[5] = 0x00;
            dataBuf[6] = 0x00;
            //DTR 表示数据长度为多少位 7-10
            dataBuf[7] = 0x00;
            dataBuf[8] = 0x00;
            dataBuf[9] = 0x00;
            dataBuf[10] = 0x08;
            //DHR 左直右人 11-14 （发送04 04 04 04全绿）
            dataBuf[11] = 0x04;
            dataBuf[12] = 0x04;
            dataBuf[13] = 0x04;
            dataBuf[14] = 0x04;
            //DLR 0xbb 命令字 阶段顺序号 剩余秒数 15-18  09 05 01 20
            dataBuf[15] = 0x20;  //秒数
            dataBuf[16] = 0x01;  //阶段
            dataBuf[17] = 0x05;  //命令字
            dataBuf[18] = 0x09;  //0xbb
            //结尾
            dataBuf[28] = GetSumForCommand(dataBuf);
            dataBuf[29] = 0x88;

            return dataBuf;

        }
        #endregion
    }
}
